money = 100000      # 本金100000元
year = 0            # 理财年数赋初值为0
while money>=0:
    money = round(money*(1+0.037),2)-20000
    year += 1
print(year,'年后资金被全部取出')